package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ContactCentre generated by hbm2java
 */
@Entity
@Table(name = "Contact_Centre", schema = "dbo", catalog = "imgbms")
public class ContactCentre implements java.io.Serializable {

	private ContactCentreId id;
	private Contact contact;
	private Centre centre;
	private Date startDate;
	private Date endDate;

	public ContactCentre() {
	}

	public ContactCentre(ContactCentreId id, Contact contact, Centre centre) {
		this.id = id;
		this.contact = contact;
		this.centre = centre;
	}

	public ContactCentre(ContactCentreId id, Contact contact, Centre centre,
			Date startDate, Date endDate) {
		this.id = id;
		this.contact = contact;
		this.centre = centre;
		this.startDate = startDate;
		this.endDate = endDate;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "centreId", column = @Column(name = "centreId", nullable = false)),
			@AttributeOverride(name = "contactId", column = @Column(name = "contactId", nullable = false)) })
	public ContactCentreId getId() {
		return this.id;
	}

	public void setId(ContactCentreId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contactId", nullable = false, insertable = false, updatable = false)
	public Contact getContact() {
		return this.contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "centreId", nullable = false, insertable = false, updatable = false)
	public Centre getCentre() {
		return this.centre;
	}

	public void setCentre(Centre centre) {
		this.centre = centre;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "StartDate", length = 16)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EndDate", length = 16)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
